import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralOrgStaffRelation = (params) => {
  params.head.transCode = 'queryGeneralOrgStaffRelation';
  return request({
    url: '/general/generalOrgStaffRelation/queryGeneralOrgStaffRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralOrgStaffRelationListByPage = (params) => {
  params.head.transCode = 'queryGeneralOrgStaffRelationListByPage';
  return request({
    url: '/general/generalOrgStaffRelation/queryGeneralOrgStaffRelationListByPage',
    method: 'post',
    data: params
  })
}

//多条列表查询，支持条件查询
export const queryGeneralOrgStaffRelationListPage = (params) => {
  params.head.transCode = 'queryGeneralOrgStaffRelationListPage';
  return request({
    url: '/general/generalOrgStaffRelation/queryGeneralOrgStaffRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralOrgStaffRelation = (params) => {
  params.head.transCode = 'saveGeneralOrgStaffRelation';
  return request({
    url: '/general/generalOrgStaffRelation/saveGeneralOrgStaffRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralOrgStaffRelationList = (params) => {
  params.head.transCode = 'saveGeneralOrgStaffRelationList';
  return request({
    url: '/general/generalOrgStaffRelation/saveGeneralOrgStaffRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralOrgStaffRelation = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralOrgStaffRelation';
  return request({
    url: '/general/generalOrgStaffRelation/saveOrUpdateGeneralOrgStaffRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralOrgStaffRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralOrgStaffRelationList';
  return request({
    url: '/general/generalOrgStaffRelation/saveOrUpdateGeneralOrgStaffRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralOrgStaffRelation = (params) => {
  params.head.transCode = 'updateGeneralOrgStaffRelation';
  return request({
    url: '/general/generalOrgStaffRelation/updateGeneralOrgStaffRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralOrgStaffRelation = (params) => {
  params.head.transCode = 'deleteGeneralOrgStaffRelation';
  return request({
    url: '/general/generalOrgStaffRelation/deleteGeneralOrgStaffRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralOrgStaffRelationList = (params) => {
  params.head.transCode = 'deleteGeneralOrgStaffRelationList';
  return request({
    url: '/general/generalOrgStaffRelation/deleteGeneralOrgStaffRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralOrgStaffRelationExcel = (params) => {
  downloadExcel({
    url: '/general/generalOrgStaffRelation/excelDownload/exportGeneralOrgStaffRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
